<template>
  <div class="recipe-cx">
    <div class="lb" v-if="datalist[0]">
      <div class="lb_xq" >
        <div class="lb_xq_box">
           <div class="lb_xq_box_item">
             <span class="el-icon-tableware"></span>
           </div>
        <h3 class="lb_xq_box_item_one">{{sp.cname}}</h3>
        </div>
        <router-link class="colock" :to="`/recipeflxq/${sp.cid}`">更多></router-link>
      </div>
      <div class="lb_main" v-for="i in datalist" :key="i.rid">
        <div>
          <router-link :to="`/recipexq/${i.rid}`">
            <img :src="i.r_pic" alt="" class="tptp">
          </router-link>
        </div>
        <div>
          <div>
            <!-- <a href="">{{i.rname}}</a> -->
            <router-link :to="`/recipexq/${i.rid}`">{{i.rname}}</router-link>
            <span>评分：{{i.score}}</span>
          </div>
          <div>
            <img src="/img/1.jpg" alt="">
            <router-link :to="`/userkj/${i.r_uname}`">{{i.r_uname}}</router-link>
          </div>
        </div>
      </div>
      
    </div>
  </div>
</template>

<script>
  export default {
    props:["sp"],
    data() {
      return {
        datalist: []
      }
    },
    methods: {
      getfllist() {
        const url="/spfllist"
        const params=`cname=${this.sp.cid}`
        this.axios.post(url,params).then((res)=>{
          this.datalist=res.data.data
          // console.log(this.datalist)
        })
      },
    },
    mounted(){
      this.getfllist()
    }
  }
</script>

<style lang="scss" scoped>

*{
  margin: 0;
  padding: 0;
}
.lb_xq_box{
  display: flex;
  align-items: center;
}
.lb_xq_box_item{
  width: 50px;
  height: 40px;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  background-color: #ffe851;
  margin-left: 10px;
  display: flex;
  justify-content: center;
  align-items: center;

}
.lb_xq_box_item_one{
  background-color: white;
  margin: 0px;
  width: 60px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}
.colock{
  color: black;
  font-weight: 600;
}
.colock:hover{
  color: #f83527;
}
  .rexipe_cx{
    width: 1200px;
    margin: 0 auto;
  }
  .lb{
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 25px;
    border-radius: 15px;
    // background-color: rgb(228, 226, 226);
    background-color: #f1f1f1;
  }
  .lb_xq{
    width:1200px;
    // margin:10px;
    display:flex;
    justify-content: space-between;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    margin-top: 10px;

  
    a{
      font-size: 16px;
      margin-right: 15px;
      margin-top: 14px;
    }
  }
  .lb_main{
    width: 371px;
    background-color: white;
    display: flex;
    margin: 13px 14px;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 15px;
  }
  .lb_main>div{
    width: 50%;
  }
  .lb_main>div:first-child img{
    display:block;
    width: 100%;
    height: 150px;
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
  }
  .lb_main>div:last-child{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 18px;
    box-sizing: border-box;
    padding: 5px;
    padding-left: 10px;
    a{
      color: #000;
    }
    span{
      display: block;
      font-size: 14px;
      // margin-left: 5px;
      margin-top: 10px;
      padding: 5px;
      background-color: rgb(212, 209, 209);
      width: 70px;
      text-align: center;
      border-radius: 5px;
    }
    div:last-child{
      display: flex;
      align-items: center;
      font-size: 16px;
      margin-bottom: 12px;
      img{
        margin-right: 5px;
        width: 25px;
        border-radius: 50%;
      }
    }

  }
</style>